package main

import "fmt"

type Person struct {
	name string
	sex byte
	age int
}

func (p *Person) PrintInfoPointer() {
	fmt.Printf("%p, %v\n", p, p)
}

func (p Person) PrintInfoValue() {
	fmt.Printf("%p, %v\n", &p, p)
}

func main() {
	p := Person{"mike", 'm', 18}
	p.PrintInfoPointer()

	pFunc1 := p.PrintInfoPointer
	pFunc1()

	pFunc2 := p.PrintInfoValue		//值传递
	pFunc2()


	pFunc3 := (*Person).PrintInfoPointer
	pFunc3(&p)

	pFunc4 := Person.PrintInfoValue	//值传递
	pFunc4(p)
}
